package com.gopay.common.gateway.manager.impl;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gopay.common.domain.pg.PgCbRmbOrderAssistDtl;
import com.gopay.common.domain.pg.PgCbRmbOrderTransDtl;
import com.gopay.common.gateway.dao.PgCbRmbOrderAssistDtlDAO;
import com.gopay.common.gateway.dao.PgCbRmbOrderTransDtlQueryDAO;
import com.gopay.common.gateway.manager.PgCbRmbOrderTransDtlQueryManager;

@Service("pgCbRmbOrderTransDtlQueryManager")
public class PgCbRmbOrderTransDtlQueryManagerImpl implements PgCbRmbOrderTransDtlQueryManager {
    
    @Resource(name = "pgCbRmbOrderTransDtlQueryDAO")
    private PgCbRmbOrderTransDtlQueryDAO pgCbRmbOrderTransDtlQueryDAO;
    
    @Resource(name = "pgCbRmbOrderAssistDtlDAO")
    private PgCbRmbOrderAssistDtlDAO pgCbRmbOrderAssistDtlDAO;
    
    @Override
    public PgCbRmbOrderTransDtl get(Serializable id) {
        return pgCbRmbOrderTransDtlQueryDAO.find(PgCbRmbOrderTransDtl.class, id);
    }

    @Override
    public List<PgCbRmbOrderTransDtl> get(Map<Object, Object> paraMap) {
        return null;
    }

    @Override
    public List<PgCbRmbOrderTransDtl> getAll() {
        return pgCbRmbOrderTransDtlQueryDAO.findAll(PgCbRmbOrderTransDtl.class);
    }
    @Override
    @Transactional
    public void  update(PgCbRmbOrderTransDtl  dtl) {
    	// TODO Auto-generated method stub
    	 pgCbRmbOrderTransDtlQueryDAO.update(dtl);
    }
    @Override
    public  List<PgCbRmbOrderTransDtl>  getlistMerOrderId(String merId, String merOrderId){
    	String hql="from PgCbRmbOrderTransDtl where  merId=:merId and merOrderId=:merOrderId";
    	Map<String,Object> map=new HashMap<String, Object>();
    	map.put("merId", merId);
    	map.put("merOrderId", merOrderId);
   	 List<PgCbRmbOrderTransDtl> list= pgCbRmbOrderTransDtlQueryDAO.findByHql(hql, map);
   	 return  list;
    	
    }

    @Override
    public PgCbRmbOrderAssistDtl getPgCbRmbOrderAssistDtlBySq(Integer transDtlSq) {
        return pgCbRmbOrderAssistDtlDAO.findPgCbrAssistDtl(transDtlSq);
    }

    

}